<?php

namespace App\Http\Controllers\Backend;


use App\Manage\SiteConfigManage;
use App\Models\SiteInfo;

class SiteConfigController extends BaseController
{

    // 话题
    public function initialize()
    {
        parent::initialize();

        $this->model = 'SiteConfig';
    }

    // 父级
    // 添加，修改，删除，列表，停用 操作

    // 获取配置信息
    public function get()
    {
        $lists = (new SiteConfigManage())->getConfig();

        return $this->success($lists);
    }


    // 保存配置信息
    public function save()
    {
        $log = new SiteConfigManage();
        $res = $log->saveConfig();
        if($res === false){
            return $this->error($log->getError());
        }

        return $this->success();
    }

}


